﻿using System.Diagnostics.Contracts;

namespace System.Reactive.Subjects
{
	[ContractClass(typeof(IConnectableObservableContract<>))]
#if WINDOWS_PHONE
	public interface IConnectableObservable<T> : IObservable<T>
#else
	public interface IConnectableObservable<out T> : IObservable<T>
#endif
	{
		IDisposable Connect();
	}

	[ContractClassFor(typeof(IConnectableObservable<>))]
	internal abstract class IConnectableObservableContract<T> : IConnectableObservable<T>
	{
		public IDisposable Connect()
		{
			Contract.Ensures(Contract.Result<IDisposable>() != null, null, "Contract.Result<IDisposable>() != null");
			return null;
		}

		public IDisposable Subscribe(IObserver<T> observer)
		{
			return null;
		}
	}
}